<template>
  <canvas id="canvas" @click="AuthCode.handleCanvas()"> </canvas>
</template>

<script>
import { onMounted } from 'vue'

import { UseAuthCode } from '@/stores/utils'
export default {
  name: 'AuthCode',
  props: {
    code: {
      default: ''
    }
  },
  setup() {
    const AuthCode = UseAuthCode()

    onMounted(() => {
      AuthCode.draw(AuthCode.yanzhen_arr)
    })

    return {
      AuthCode
    }
  }
}
</script>

<style lang="scss" scoped>
canvas {
  cursor: pointer;
  width: 130px;
  height: 40px;
  margin-left: 30px;
  border: 1px solid $font_unactive;
  border-radius: 4px;
}
</style>
